| Conditions | 3 |
| Paths | 3 |
| Total Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | define(['leaflet', 'helper'], |
||
| 15 | drawTile: function (canvas, tilePoint) { |
||
| 16 | if (!this.data) { |
||
| 17 | return; |
||
| 18 | } |
||
| 19 | |||
| 20 | var tileSize = this.options.tileSize; |
||
| 21 | var s = tilePoint.multiplyBy(tileSize); |
||
| 22 | var map = this._map; |
||
| 23 | |||
| 24 | var margin = 50; |
||
| 25 | var bbox = helper.getTileBBox(s, map, tileSize, margin); |
||
| 26 | |||
| 27 | var nodes = this.data.search(bbox); |
||
| 28 | |||
| 29 | if (nodes.length === 0) { |
||
| 30 | return; |
||
| 31 | } |
||
| 32 | |||
| 33 | var ctx = canvas.getContext('2d'); |
||
| 34 | var startDistance = 12; |
||
| 35 | |||
| 36 | ctx.beginPath(); |
||
| 37 | nodes.forEach(function (d) { |
||
| 38 | var p = map.project([d.node.nodeinfo.location.latitude, d.node.nodeinfo.location.longitude]); |
||
| 39 | |||
| 40 | p.x -= s.x; |
||
| 41 | p.y -= s.y; |
||
| 42 | |||
| 43 | helper.positionClients(ctx, p, d.startAngle, d.node.statistics.clients, startDistance); |
||
| 44 | }); |
||
| 45 | |||
| 46 | ctx.fillStyle = 'rgba(220, 0, 103, 0.7)'; |
||
| 47 | ctx.fill(); |
||
| 48 | } |
||
| 49 | }); |
||
| 51 |